<template>
  <div class="main-panel">
    <div class="menus">
      <div v-for="(menu, index) in menus" :key="index" @click="toPage(menu)">
        {{ menu.name }}
      </div>
    </div>
    <!--  -->
    <div style="padding: 20px; width: 80%">
      <router-view></router-view>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";

const router = useRouter();

// 菜单列表
const menus = ref([
  { name: "登录首页", href: "/menu/home" },
  { name: "登录统计", href: "/menu/count" },
]);
const toPage = async (menu) => {
    let paths = menu.href;
    router.push(paths);
};
</script>

<style  scoped>
.main-panel {
  display: flex;
  color: #64676a;
  max-width: 100%;
}

.menus {
  line-height: 55px;
  text-align: center;
  width: 20%;
  height: 100%vh;
  border-right: 2px solid #dadada;
  cursor: pointer;
}

.title {
  font-size: 65px;
  font-weight: bold;
  text-align: right;
  position: fixed;
  color: rgba(0, 0, 0, 20%);
  right: calc((100vw - 1500px) / 2);
  bottom: 20px;
}
</style>